package com.controller;

import java.sql.Connection;
import java.sql.SQLException;
import oracle.jdbc.pool.OracleDataSource;

public class OraConnection {

    public static Connection open(String url,String userId,String password){
          String jdbcurl = url;
          String userid = userId;
          String passwordid = password;
          Connection conn=null;
          try {
              OracleDataSource ds;
              ds = new OracleDataSource();
              ds.setURL(url);
              conn = ds.getConnection(userId, password);
              System.out.println("Koneksi is OK");
          } catch (SQLException e) {
               // perform error handling here
              System.out.println("error :"+ e.getMessage());
          }
          return conn;
     }
}
